var mongoose = require('mongoose');

var dbhost = "47.93.250.131";
var dbport = 27017;
var dbname = "uesrlist";
var dbuser = "wjp";
var dbpass = "wjp268hh";

// var conn_db_str = `mongodb://${dbhost}:${dbport}/${dbname}`;
var conn_db_str =  `mongodb://${dbuser}:${dbpass}@${dbhost}:${dbport}/${dbname}`

mongoose.connect(conn_db_str,{
    useNewUrlParser:true,
    useUnifiedTopology:true
},function(err){
    if(err){
        console.log("数据库连接失败");
    }else{
        console.log("数据库连接成功");
    }
})